pkgname=vdr-streamdev
pkgver=0.3.1.20070428
pkgrel=1
arch=('i686')
pkgdesc="A video streaming plugin for VDR"
url="http://linux.kompiliert.net/index.php?view=streamdev-unstable"
license=('GPL')
backup=('etc/vdr/plugins/streamdevhosts.conf')
depends=('vdr' 'gcc')
source=()
md5sums=()

_cvsroot=":pserver:anoncvs@vdr-developer.org:/var/cvsroot"
_cvsmod="streamdev"

build() {
  cd $startdir/src

  msg "Connecting to CVS server...."

  if [ -d $_cvsmod/CVS ]; then
    cd $_cvsmod
    cvs -z3 update -d
    cd ..
  else
    cvs -z3 -d $_cvsroot co -D `echo $pkgver | cut -d . -f 4` -f $_cvsmod
  fi

  msg "CVS checkout done or server timeout"
  msg "Starting make..."

  rm -rf $_cvsmod-build
  cp -r $_cvsmod $_cvsmod-build
  cd $_cvsmod-build

  sed -i \
	 -e 's:@cp $@ :install -D -m 755 $@ $(DESTDIR):' \
	 -e 's:-I$(VDRDIR)/include:-I$(VDRDIR):' \
	 Makefile
  make VDRDIR=/usr/include/vdr LIBDIR=/usr/lib/vdr DESTDIR=$startdir/pkg all || return 1

  install -m 644 -D streamdevhosts.conf.example $startdir/pkg/etc/vdr/plugins/streamdevhosts.conf
}
